package cn.tedu.service;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Service;

/**
 * @author Administrator
 */
@Service
@Aspect
public class AspectTest {
    @Pointcut("execution(* cn.tedu.service..*.*(..))")
    public void point(){
    }
    @Around("cn.tedu.service.AspectTest.point()")
    public Object doAround(ProceedingJoinPoint joinPoint) throws Throwable {
            long time = System.currentTimeMillis();
            Object proceed = joinPoint.proceed();
            time = System.currentTimeMillis()-time;
            System.out.println("运行时间是"+time);
            return proceed;
    }
}
